import { CouresLabelMap } from "@/enums/school/course.enum";
import { TeacherTitleEnum } from "@/enums/school/teacher.enum";

// 获取课程列表
export const getCourse = () => {
  const results = Object.entries(CouresLabelMap);
  return results.map(item => {
    const [value, label] = item;
    return { label, value };
  });
};
// 获取年级班级
export const getGradeAndClassLabel = (text: `${number}-${number}`) => {
  const [_Grade, _Class] = text.split("-");
  const gradeLabelMap = { 1: "高一", 2: "高二", 3: "高三" };
  const grade: keyof typeof gradeLabelMap = +_Grade as keyof typeof gradeLabelMap;
  return `${gradeLabelMap[grade]}${_Class}班`;
};

// 获取年级和班级
export const getGradeAndClass = () => {
  const _Grade = ["高一", "高二", "高三"];
  const _Class = 9;
  let options = [];
  for (let i = 1; i <= _Grade.length; i++) {
    for (let j = 1; j <= _Class; j++) {
      options.push({ value: `${i}-${j}`, label: `${_Grade[i - 1]}${j}班` });
    }
  }
  return options;
};

// 获取职称列表
export const getTeacherTitle = () => {
  const results = Object.entries(TeacherTitleEnum);
  return results.map(item => {
    const [value, label] = item;
    return { label, value };
  });
};

// 获取性别列表
export const getGender = () => {
  return [
    { label: "男", value: 1 },
    { label: "女", value: 2 },
    // { label: "未知", value: 3 },
  ];
};
